<template>
  <div>
    <h1>我是衣服</h1>
    <button @click="turnKu">去裤子组件</button>
  </div>
</template>
<script>
// vue路由的编程式跳转
// this.$router.push()
export default {
  methods: {
    turnKu () {
      //  this.$router.push('path路径')
      // this.$router.push('/cate/catetwo')
      //   //  this.$router.push({name:"",query:{}})
      //  this.$router.push({name:"",params:{}})
      // this.$router.push({ name: 'catetwo', query: { kid: 888 } })
      this.$router.push({ name: 'catetwo', params: { myid: 1888 } })
      //不产生历史记录跳转 this.$router.replace()
      // this.$router.replace({ name: 'catetwo', query: { hh: 11 } })
    }
  }
}
</script>
<style lang="less"></style>
